package com.sinog.alarm.mapper.db2;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sinog.alarm.model.Department;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;

/**
 * @desc DepartmentMapper
 * @author wangxj
 * @date -
 */
@DS("db2")
public interface DepartmentMapper extends BaseMapper<Department> {

    /**
     * 根据level和pid查询tbsys_department表最小id
     * @param level level
     * @param pid pid
     * @return String
     */
    String selectMinDeptId(@Param("level") String level,@Param("pid") String pid);

    /**
     * 查询tbsys_department表sn序列号最大+1
     * @param codeId codeId
     * @param level level
     * @return String
     */
    String  selectMaxDeptIdInce(@Param("codeId") String codeId,@Param("level") String level);


    /**
     * 根据ID查询部门信息
     * @param id id
     * @return Department
     */
    Department selectByDeptId(@Param("id") String id);

    /**
     * 根据id删除tbsys_department
     * @param id id
     */
    void deleteById(@Param("id") String id);

    /**
     * 新增部门
     * @param department department
     */
    void insertDepartment(Department department);

    /**
     * 修改部门
     * @param department department
     * @param paramMap paramMap
     */
    void updateDepartmentById(@Param("department") Department department,@Param("paramMap")Map<String,String> paramMap);

    /**
     * 根据id查询部门信息
     * @param id id
     * @param pid pid
     * @return List<Map<String,Object>>
     */
    List<Map<String,Object>> selectDepartmentById(@Param("id") String id,@Param("pid") String pid);
}